﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BUIANHQUAN.EXCERCISES.EX04
{
    class DateControllers
    {
        public int CheckDayOfMonth(int Months, int Years)
        {
            int Days = 0;
            if (Months == 2)
            {
                if (Years % 4 == 0)
                {
                    Days = 29;
                }
                else
                {
                    Days = 28;
                }
            }
            else if (Months == 4 || Months == 11 || Months == 6 || Months == 9)
            {
                Days = 30;
            }
            else
            {
                Days = 31;
            }
            return Days;
        }
    }
}
